#include <iostream>
using namespace std;


bool dfs(long long a,long long b){
	if(a == b)
		return true;
	if(a > b)
		return false;
	if(dfs(a*2,b)  ||  dfs(a*10+1,b))
		return true;
	else
		return false;
}


int main(){
	int t;
	cin>>t;
	for(int i=0;i<t;i++){
		long long a,b;
		cin>>a>>b;
		if(dfs(a,b))
			cout<<"YES"<<endl;
		else
			cout<<"NO"<<endl;
	}
	return 0;
}
